/*
	YoghurtGum - 2D Game Engine

	Copyright 2009-2011 Quinten Lansu
	
	Licensed under the Apache License, Version 2.0 (the "License"); you may not 
	use this file except in compliance with the License. You may obtain a copy 
	of the License at 
		
		http://www.apache.org/licenses/LICENSE-2.0 
		
	Unless required by applicable law or agreed to in writing, software 
	distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 
	WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 
	License for the specific language governing permissions and limitations 
	under the License. 
*/

#ifndef _YGINPUTANDROID_H_
#define _YGINPUTANDROID_H_

#include "YGInput.h"
#include "YGDevice.h"

namespace YoghurtGum
{

	class KeyboardAndroid : public Keyboard
	{
	
	public:
	
		KeyboardAndroid();
		~KeyboardAndroid();

		void Init();
		void Clear();
		void Update();

		bool Pressed(Key a_Key);
		bool Released(Key a_Key);

		void InjectPress(Key a_Key);
		void InjectRelease(Key a_Key);

	private:

		bool m_KeysPressed[256];
		bool m_KeysReleased[256];
		bool m_KeysChanged[256];
		bool m_Padding[256];
	
	}; YG_ALIGN // class KeyboardAndroid

	class TouchScreenAndroid : public TouchScreen
	{

	public:

		Vec2 GetPos();
		float GetX();
		float GetY();
		int GetScreenX();
		int GetScreenY();

		bool Released();
		bool Pressed();

		void Init();
		void Resize(int a_Width, int a_Height);
		void InjectPress(float a_X, float a_Y);
		void InjectRelease(float a_X, float a_Y);
		void Clear();

		TouchScreenAndroid();
		~TouchScreenAndroid();

	protected:

		Device* m_Device;
		float m_DeviceX, m_DeviceY;
		float m_X, m_Y;
		int m_ScreenX, m_ScreenY;
		bool m_Pressed, m_Released, m_Clear;

	}; // class TouchScreenAndroid

}; // namespace YoghurtGum
	
#endif